from Finance_fun import page
from Finance_fun.base.base import Base


class PageCollectionPlan(Base):
    # 点击我的收款计划
    def my_skjh(self):
        self.base_click(page.my_skjh)

    # 选择结束日期
    def check_end_date(self, end_date):
        self.base_input(page.end_date, end_date)

    # 还款日期输入
    def input_hk(self, starttime):
        self.base_input(page.start_time, starttime)

    # 筛选关键字
    def my_collection_plan(self, keywords):
        self.base_input(page.gjz, keywords)

    # 点击筛选按钮
    def click_filter_btn(self):
        self.base_click(page.filter_btn)

    # 点击登录链接
    def page_click_login_link(self):
        self.base_click(page.login_link)

    # 输入登录手机号
    def page_input_login_phone(self, phone):
        self.base_input(page.login_phone, phone)

    # 输入登录密码
    def page_input_login_password(self, password):
        self.base_input(page.login_password, password)

    # 点击登录按钮
    def page_click_login_btn(self):
        self.base_click(page.login_btn)

    # 集成登录操作
    def page_login(self, phone, password):
        self.page_input_login_phone(phone)
        self.page_input_login_password(password)
        self.page_click_login_btn()
        time.sleep(1)